import React, { useState, useEffect } from 'react';
import { Dialog } from 'antd-mobile';

/**
 * 角色卡/世界卡 创建方式选择组件
 */
const CreationMethod = ({ show, onSelect }) => {
  const [visible, setVisible] = useState(show);

  const handleSelect = (type) => {
    onSelect(type);
    setVisible(false);
  };

  return (
    <>
      <Dialog
        visible={visible}
        onClose={() => setVisible(false)}
        title="选择创建方式"
        actions={[
          { key: 'ai', text: '智能创建', onClick: () => handleSelect('ai') },
          { key: 'normal', text: '普通创建', onClick: () => handleSelect('normal') },
        ]}
      />
    </>
  );
}

export default CreationMethod;